<?php

namespace app\common\services;

use app\common\model\Doc as DocModel;
use think\facade\Db;

use think\facade\Cache;

class DocService
{

    public static function list(array $data,$page_info)
    {
        return DocModel::where($data)
            ->order('weigh desc')
            ->paginate($page_info['num'])->toArray();
    }
    
    // 详情
    public static function info($id){
        
        $info = DocModel::where('id',$id)->find();
        return $info;
    }
    
    /**
     * 添加
     */
    public static function add($data){
        
        $doc = new DocModel;
        $doc->allowField(true)->save($data);
    }
}